import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
Vue.config.productionTip = false
Vue.prototype.$http = axios;
// 请求拦截器：给所有的请求 都加上 请求头部 携带token到后端
axios.interceptors.request.use(function(config){
    config['headers']['Authorization'] = "Bearer "+localStorage.getItem("token");
    return config;
}) 
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
